package com.adhere.auth.remote;

import com.adhere.auth.pojo.LoginUser;
import com.adhere.auth.remote.fallback.RemoteUserFallbackFactory;
import com.adhere.common.pojo.Result;
import com.adhere.common.constants.ServiceNameConstants;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 *
 * @author WT
 * @date 2022/02/07 15:06:35
 */
@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteUserFallbackFactory.class)
// @FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.SYSTEM_SERVICE, url = "http://localhost:10010", fallbackFactory = RemoteUserFallbackFactory.class)
public interface RemoteUserService {

    /**
     * 通过登录用户名查询用户信息
     *
     * @param loginName 用户登录名
     * @return 结果
     */
    @GetMapping("/users/login/{loginName}")
    Result<LoginUser> getUserByLoginName(@PathVariable("loginName") String loginName);

}
